using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace RiceShop.Models
{
    /// <summary>
    /// 用户实体类
    /// </summary>
    [Table("User")]
    public class User
    {
        /// <summary>
        /// 用户ID，主键
        /// </summary>
        [Key]
        [Column("id")]
        public long Id { get; set; }

        [StringLength(100)]
        [Column("openId")]
        public string OpenId { get; set; } = string.Empty;

        /// <summary>
        /// 用户昵称
        /// </summary>
        [Required]
        [StringLength(100)]
        [Column("nickName")]
        public string NickName { get; set; } = string.Empty;

        /// <summary>
        /// 用户头像URL
        /// </summary>
        [StringLength(500)]
        [Column("avatarUrl")]
        public string AvatarUrl { get; set; } = string.Empty;

        /// <summary>
        /// 性别（0:未知,1:男,2:女）
        /// </summary>
        [Column("gender")]
        public byte Gender { get; set; }

        /// <summary>
        /// 国家
        /// </summary>
        [StringLength(50)]
        [Column("country")]
        public string Country { get; set; } = string.Empty;

        /// <summary>
        /// 省份
        /// </summary>
        [StringLength(50)]
        [Column("province")]
        public string Province { get; set; } = string.Empty;

        /// <summary>
        /// 城市
        /// </summary>
        [StringLength(50)]
        [Column("city")]
        public string City { get; set; } = string.Empty;

        /// <summary>
        /// 手机号码
        /// </summary>
        [StringLength(20)]
        [Column("phoneNumber")]
        public string PhoneNumber { get; set; } = string.Empty;

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("createTime")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [Column("updateTime")]
        public DateTime UpdateTime { get; set; }

        /// <summary>
        /// 最后登录时间
        /// </summary>
        [Column("lastLoginTime")]
        public DateTime LastLoginTime { get; set; }

        /// <summary>
        /// 状态（0:未激活,1:已激活）
        /// </summary>
        [Column("status")]
        public byte Status { get; set; }

        /// <summary>
        /// 是否删除（软删除）
        /// </summary>
        [Column("isDeleted")]
        public bool IsDeleted { get; set; }
    }
}